﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace QuanLyCayXanh.Models
{
    [Table("Ward")]
    public partial class Ward
    {
        public Ward()
        {
            this.Addresses = new HashSet<Address>();
        }
        
        public int Id { get; set; }
        [Required(ErrorMessage = "{0} không được bỏ trống!")]
        [Display(Name="Phường/Xã")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Vui lòng chọn Quận/Huyện")]
        [ForeignKey("District")]        
        public int District_Id { get; set; }

        public virtual ICollection<Address> Addresses { get; set; }
        public virtual District District { get; set; }
       
    }
}